/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package AirLine;

import java.io.Serializable;

/**
 *
 * @author smulle
 */
public class Airline implements Comparable, Serializable {
    private String name;
    private int discount;
    private String code;
    private String dbIdentifier;
    
    public Airline(String name, int discount, String code, String dbid) {
        this.name = name;
        this.discount = discount;
        this.code = code;
        dbIdentifier = dbid;
    }
    public String getName() {
        return name;
    }
    public int getDiscount() {
        return discount;
    }
    public String getCode() {
        return code;
    }

    public String getDbIdentifier() {
        return dbIdentifier;
    }
    
    public int compareTo(Object o) {
        if (o instanceof Airline) {
            return compareTo((Airline) o);
        } else {
            System.out.println("NJAAAA, INTE HIT!!!");
            
            return -1;
        }
    }

    public int compareTo(Airline a) {

                return getCode().compareTo(a.getCode());
    }
}
